<?php

class WBRectangle extends WBShape { 
	public function __construct($options = array()) { 
		parent::__construct($options);
	}
	
	protected function initShape() { 
		if (!isset($this->color)) 	$this->setOption('color', 	BLACK);
		if (!isset($this->fill)) 	$this->setOption('fill', 	true);
		if (!isset($this->line)) 	$this->setOption('line', 	1);
		if (!isset($this->style)) 	$this->setOption('style', 	WBDraw::LINE_SOLID);
	}
	
	/**
	 * render shape 
	 * 
	 * @see PObject#display()
	 */
	public function display(WBGraphics $graphics) {
		$graphics->rect(
			$this['x'],
			$this['y'],
			$this['width'],
			$this['height'],
			$this['color'],
			$this['fill'],
			$this['line'],
			$this['style']
		);
	}
}

?>